package com.gzhryc.weixin.gzh;

import com.gzhryc.weixin.gzh.models.AccessToken;
import org.apache.commons.lang3.StringUtils;

public abstract class AbsWeixinApi {

	protected final AccessToken accessToken;
	
	public AbsWeixinApi(AccessToken accessToken){
		this.accessToken = accessToken;
	}

	public AccessToken getAccessToken() {
		return accessToken;
	}

	/**
	 * 判断API响应是否是错误信息
	 * @param result
	 * @return
	 */
	public static boolean isError(String result){
		return StringUtils.contains(result, "errcode");
	}
}
